import {Environment} from "./Environment";
import {HttpClient} from "../net/HttpClient";

class Application {
    constructor() {
        //环境应该管理摄像机、场景、对象渲染、游戏主角控制器等
        this.environment = new Environment();
        this.httpClient=new HttpClient();
    }

    //处理网络相关操作
    init() {
        //初始化当前环境
        this.getPlayerPosition(this.getAroundThings());
    }

    //首先获取当前玩家离线时的世界坐标
    getPlayerPosition(callback) {
        this.httpClient.get("").then(function (res) {
            callback(res.data.position);
        })
    }
    //通过坐标获取周围的事物
    //获取到事物后需要将其加载到对象池中
    getAroundThings(obj) {
        this.httpClient.get("").then(function (res) {

        })
    }


    run() {
        this.init();
        this.environment.render();
    }
}